package com.maopuyu.services;


import com.maopuyu.entity.Video;
import com.maopuyu.repositories.VideoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class VideoService {
    @Autowired
    private VideoRepository videoRepository;

    public Video findVideoById(Integer id) {
        return videoRepository.findVideoById(id);
    }

    public List<Video> findAllBySeriesId(Integer id) {
        return videoRepository.findAllBySeriesIdOrderByTitleAsc(id);
    }
}
